package cn.tedu.ivos2.user.service.impl;

import cn.tedu.ivos2.base.exception.ServiceException;
import cn.tedu.ivos2.base.response.StatusCode;
import cn.tedu.ivos2.user.mapper.UserMapper;
import cn.tedu.ivos2.user.pojo.dto.UserLoginParam;
import cn.tedu.ivos2.user.pojo.vo.UserVO;
import cn.tedu.ivos2.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public UserVO login(UserLoginParam userLoginparam) {
        log.debug("用户登录业务：{}", userLoginparam);
        UserVO userVO =userMapper.selectByUsername(userLoginparam.getUsername());
        if(userVO== null){
            throw new ServiceException(StatusCode.USERNAME_ERROR);
        }
        return null;
    }
}
